use std::path::{Path, PathBuf};
use walkdir::WalkDir;

/// 遍历目录获取所有Excel文件路径
pub fn get_excel_files(path: &Path) -> Vec<PathBuf> {
    WalkDir::new(path)
        .into_iter()
        .filter_map(|entry| entry.ok())
        .filter(|entry| entry.file_type().is_file())
        .filter(|entry| entry.path().extension().map_or(false, |ext| ext == "xlsx"))
        .map(|entry| entry.path().to_path_buf())
        .collect()
}

pub fn myround(value: f64) -> f64 {
    (value * 100.0).round() / 100.0
}